package com.sline.test;

import java.io.*;
import java.util.ArrayList;

public class test1 {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new FileReader("abc.txt"));

        ArrayList<String> arr = new ArrayList<>();

        String line;
        while ((line = br.readLine()) != null) {
            arr.add(line);
        }

        br.close();

        BufferedWriter bw = new BufferedWriter(new FileWriter("xxx.txt"));
        for (int i = arr.size() - 1; i >= 0; i--) {
            bw.write(arr.get(i));
            bw.newLine();
        }

        bw.close();
    }
}
